// 用于主页面通用内容
import Main from '@/views/main.vue';
// 用于二级页面的内容
import SubMain from '@/views/sub-main.vue';

export default {
	path: '/user',
	name: 'user',
	redirect: '/user/retail/user',
	meta: {
		title: '用户',
		icon: 'ios-people'
	},
    component: Main,
    children: [
    	{
			path: 'retail',
			name: 'user_retail',
			meta: {
				title: '零售'
			},
			component: SubMain,
			children: [
				{
					path: 'user',
		        	name: 'user_retail_user_index',
		        	meta: {
		        		title: '会员列表'
		        	},
		        	component: resolve => {
			        	require(['@/views/user/retail/user/index.vue'], resolve)
			        }
				},
				{
					path: 'userEdit',
		        	name: 'user_retail_user_edit',
		        	meta: {
		        		title: '编辑会员',
		        		active: 'user_retail_user_index'
		        	},
		        	component: resolve => {
			        	require(['@/views/user/retail/user/edit.vue'], resolve)
			        }
				},
				{
	        		path: 'grade',
		        	name: 'user_retail_grade_index',
		        	meta: {
		        		title: '会员等级'
		        	},
		        	component: resolve => {
			        	require(['@/views/user/retail/grade/index.vue'], resolve)
			        }
	        	},
				{
	        		path: 'gradeEdit',
		        	name: 'user_retail_grade_edit',
		        	meta: {
		        		title: '会员等级编辑',
		        		active: 'user_retail_grade_index'
		        	},
		        	component: resolve => {
			        	require(['@/views/user/retail/grade/edit.vue'], resolve)
			        }
	        	},
				{
	        		path: 'group',
		        	name: 'user_retail_group_index',
		        	meta: {
		        		title: '会员分组'
		        	},
		        	component: resolve => {
			        	require(['@/views/user/retail/group/index.vue'], resolve)
			        }
	        	},
				{
	        		path: 'groupEdit',
		        	name: 'user_retail_group_edit',
		        	meta: {
		        		title: '会员分组编辑',
		        		active: 'user_retail_group_index'
		        	},
		        	component: resolve => {
			        	require(['@/views/user/retail/group/edit.vue'], resolve)
			        }
	        	},
				{
	        		path: 'integral',
		        	name: 'user_retail_integral_index',
		        	meta: {
		        		title: '积分管理'
		        	},
		        	component: resolve => {
			        	require(['@/views/user/retail/integral/index.vue'], resolve)
			        }
	        	},
				{
	        		path: 'balance',
		        	name: 'user_retail_balance_index',
		        	meta: {
		        		title: '储值管理'
		        	},
		        	component: resolve => {
			        	require(['@/views/user/retail/balance/index.vue'], resolve)
			        }
	        	}
			]
		},
		{
			path: 'wholesale',
			name: 'user_wholesale',
			meta: {
				title: '批发'
			},
			component: SubMain,
			children: [
				{
					path: 'customer',
		        	name: 'user_wholesale_customer_index',
		        	meta: {
		        		title: '客户管理',
		        		disabled: true
		        	},
		        	component: resolve => {
			        	require(['@/views/user/wholesale/customer/index.vue'], resolve)
			        }
				},
				{
	        		path: 'grade',
		        	name: 'user_wholesale_grade_index',
		        	meta: {
		        		title: '客户等级',
		        		disabled: true
		        	},
		        	component: resolve => {
			        	require(['@/views/user/wholesale/grade/index.vue'], resolve)
			        }
	        	},
				{
	        		path: 'group',
		        	name: 'user_wholesale_group_index',
		        	meta: {
		        		title: '客户分组',
		        		disabled: true
		        	},
		        	component: resolve => {
			        	require(['@/views/user/wholesale/group/index.vue'], resolve)
			        }
	        	}
			]
		},
		{
			path: 'route',
			name: 'user_route',
			meta: {
				divider: true
			},
			component: SubMain,
			children: [
				{
					path: 'seller',
		        	name: 'user_route_seller_index',
		        	meta: {
		        		title: '导购员管理',
		        		disabled: true
		        	},
		        	component: resolve => {
			        	require(['@/views/user/other/seller/index.vue'], resolve)
			        }
				},
				{
	        		path: 'supplier',
		        	name: 'user_route_supplier_index',
		        	meta: {
		        		title: '供应商管理'
		        	},
		        	component: resolve => {
			        	require(['@/views/user/other/supplier/index.vue'], resolve)
			        }
	        	},
				{
	        		path: 'supplierEdit',
		        	name: 'user_route_supplier_Edit',
		        	meta: {
		        		title: '供应商编辑',
		        		active: 'user_route_supplier_index'
		        	},
		        	component: resolve => {
			        	require(['@/views/user/other/supplier/edit.vue'], resolve)
			        }
	        	}
			]
		}
    ]
}